<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-28 01:45:38
 * @lastTime 2020-05-01 23:09:56
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */
namespace Design\Behavioral\Mediator;

class UserRepostoryUIMediator implements Mediator
{

    private $userRepostory;

    private $ui;


    public function __construct(UserRepostory $userRepostory, UI $ui)
    {
        $this->userRepostory = $userRepostory;
        $this->ui            = $ui;

        $this->userRepostory->setMediator($this);
        $this->ui->setMediator($this);

    }//end __construct()


    public function printInfoAbout(string $username)
    {
        $this->ui->outputUserInfo($username);

    }//end printInfoAbout()


    public function getUser(string $username) : string
    {
        return $this->userRepostory->getUserName($username);

    }//end getUser()


}//end class
